<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Fengadmin-内容管理系统</title>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <link rel="Bookmark" href="{{ asset('favicon.ico') }}" >
    <link rel="Shortcut Icon" href="{{ asset('favicon.ico') }}" />
    <link rel="stylesheet" href="{{ asset('static/component/pear/css/pear.css') }}">
    <link rel="stylesheet" href="{{ asset('static/admin/css/loader.css') }}">
    <link rel="stylesheet" href="{{ asset('static/admin/css/admin.css') }}">
</head>
<body class="layui-layout-body pear-admin">
<!-- 布 局 框 架 -->
<div class="layui-layout layui-layout-admin">
    <!-- 顶 部 样 式 -->
    <div class="layui-header">
        <!-- 菜 单 顶 部 -->
        <div class="layui-logo">
            <!-- 图 标 -->
            <img class="logo"></img>
            <!-- 标 题 -->
            <span class="title"></span>
        </div>
        <!-- 顶 部 左 侧 功 能 -->
        <ul class="layui-nav layui-layout-left">
            <li class="collaspe layui-nav-item"><a href="#" class="layui-icon layui-icon-shrink-right"></a></li>
            <li class="refresh layui-nav-item"><a href="#" class="layui-icon layui-icon-refresh-1" loading = 600></a></li>
        </ul>
        <!-- 多 系 统 菜 单 -->
        <div id="control" class="layui-layout-control"></div>
        <!-- 顶 部 右 侧 菜 单 -->
        <ul class="layui-nav layui-layout-right" lay-filter="layui_nav_right">
            <li class="layui-nav-item layui-hide-xs"><a href="#" class="fullScreen layui-icon layui-icon-screen-full"></a></li>
            <!--            <li class="layui-nav-item layui-hide-xs"><a href="http://{$Request.server.HTTP_HOST}" target="_blank" class="layui-icon layui-icon-website"></a></li>-->
            <li class="layui-nav-item user">
                <!-- 头 像 -->
                <a href="javascript:void(0);">
                    <i class="layui-icon layui-icon-username"></i>
                    {{ session('account_name') }}
                </a>
                <!-- 功 能 菜 单 -->
                <dl class="layui-nav-child">
                    <dd><a href="javascript:void(0);" class="password">修改密码</a></dd>
                    <dd><a href="javascript:void(0);" class="logout">退出登录</a></dd>
                </dl>
            </li>
            <!-- 主 题 配 置 -->
            <li class="layui-nav-item setting"><a href="#" class="layui-icon layui-icon-more-vertical"></a></li>
        </ul>
    </div>
    <!-- 侧 边 区 域 -->
    <div class="layui-side layui-bg-black">
        <!-- 菜 单 顶 部 -->
        <div class="layui-logo">
            <!-- 图 标 -->
            <img class="logo"></img>
            <!-- 标 题 -->
            <span class="title"></span>
        </div>
        <!-- 菜 单 内 容 -->
        <div class="layui-side-scroll">
            <div id="sideMenu"></div>
        </div>
    </div>
    <!-- 视 图 页 面 -->
    <div class="layui-body">
        <!-- 内 容 页 面 -->
        <div id="content"></div>
    </div>
    <!-- 遮 盖 层 -->
    <div class="pear-cover"></div>
    <!-- 加 载 动 画 -->
    <div class="loader-main">
        <!-- 动 画 对 象 -->
        <div class="loader"></div>
    </div>
</div>
<!-- 移 动 端 便 捷 操 作 -->
<div class="pear-collasped-pe collaspe">
    <a href="#" class="layui-icon layui-icon-shrink-right"></a>
</div>
<!-- 依 赖 脚 本 -->
<script src="{{ asset('static/component/layui/layui.js') }}"></script>
<script src="{{ asset('static/component/pear/pear.js') }}"></script>
<!-- 框 架 初 始 化 -->
<script>
    layui.use(['admin', 'jquery', 'layer','element'], function() {
        let $ = layui.jquery;
        let layer = layui.layer;
        let layelem = layui.element;
        let admin = layui.admin;

        admin.setConfigType("json");
        admin.setConfigPath("/static/config/pear.config.json");
        admin.render();

        layelem.on('nav(layui_nav_right)', function(elem) {
            if ($(elem).hasClass('logout')) {
                layer.confirm('确定退出登录吗?', function(index) {
                    layer.close(index);
                    $.ajax({
                        url: "{{ route('logout') }}",
                        type: "GET",
                        dataType: "json",
                        success: function(res) {
                            if (res.status === 1) {
                                layer.msg(res.message, {icon: 1});
                                setTimeout(function() {
                                    location.href = '{{ route('login') }}';
                                }, 333)
                            }
                        }
                    });
                });
            }else if ($(elem).hasClass('password')) {
                layer.open({
                    type: 2,
                    maxmin: true,
                    title: '修改密码',
                    shade: 0.1,
                    area: ['500px', '320px'],
                    content: '/admin/mod/' + {{ session('account_id') }}
                });
            }
        });
    })
</script>
</body>
</html>
